<html>

<head>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html,
        body {
            height: 100%;
            width: 100%;
        }

        canvas {
            display: block;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //添加窗口尺寸改变响应监听
            $(window).resize(resizeCanvas);
            //页面加载后先设置一下canvas大小
            resizeCanvas();
        });

        //窗口尺寸改变响应（修改canvas大小）
        function resizeCanvas() {
            $("#canvas").attr("width", $(window).get(0).innerWidth);
            $("#canvas").attr("height", $(window).get(0).innerHeight);
        };
    </script>
    <title>飞机大战</title>
</head>

<body>
    <canvas id="canvas" width="1440" height="789"></canvas>
    <script src="app.js"></script>
</body>

</html>